package com.mxm.mirai.bot;

import com.mxm.mirai.config.MXM_config;
import com.mxm.mirai.websocket.WebSocketFriendsServer;
import net.mamoe.mirai.message.FriendMessageEvent;

import java.util.function.Consumer;

public class BotFriend implements Consumer<FriendMessageEvent> {

    @Override
    public void accept(FriendMessageEvent event) {
        WebSocketFriendsServer.sendInfo(event);//推送到webSocket
        MXM_config.log.BotLog(String.valueOf(event.getBot().getId()),"[Bot:"+event.getBot().getId()+"][Name:"+event.getSenderName()+"][Sender:"+event.getSender().getId()+"]<br>Message:"+event.getMessage().contentToString(),false);
    }
}
